from PIL import Image
import sys
import time
import re

for imfile in sys.argv[1:]:
    im = Image.open(imfile)
    sfilename = re.sub("\.(?=[\S]+)","-enh.",imfile)
    Image.eval(im,lambda x:255 if x >190 else 0 if x < 120 else x).save(sfilename)
    print(imfile,'->',sfilename)
time.sleep(10)
